#ifndef POINTITEM_H
#define POINTITEM_H

#include <QPen>
#include <QBrush>
#include <QGraphicsEllipseItem>

#include "base/Point.h"
#include "ui/GraphicScene.h"

class PointItem : public QGraphicsEllipseItem
{
private:

    Point* _point;
    QPen penPoints;
    QBrush brushPoints;
    GraphicScene* _scene;

public:
    PointItem(Point* pt, GraphicScene* scene)
        : QGraphicsEllipseItem(pt->x()-2, pt->y()-2, 4, 4),
          _point(pt),
          penPoints(Qt::black),
          brushPoints(Qt::black),
          _scene(scene) {
        setFlag(QGraphicsItem::ItemIsMovable);
        setZValue(5);
        setBrush(brushPoints);
        setPen(penPoints);
    };
    void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
    void mousePressEvent(QGraphicsSceneMouseEvent *event);
};

#endif // POINTITEM_H
